<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" href="js/1.0.8/iconfont.min.css">
		<script type="text/javascript" src="js/jquery-1.11.0.js"></script>
		<script type="text/javascript" src="js/swiper.js"></script>
		<link rel="stylesheet" href="css/demos.css" />
		<link rel="stylesheet" href="css/jquery-weui.css" />
		<link rel="stylesheet" href="css/weui.min.css" />
		<link rel="stylesheet" type="text/css" href="css/wode.css" />
	</head>

	<body>
		<div class="tou">
			<div class="hard-one">
				<div><i class="Hui-iconfont">&#xe67d</i></div>
				<div class="dd-div">
					<div class="ding-dan">我的</div>
				</div>
				<div class="tuichu" onclick="login()">切换用户/登出</div>
			</div>
			<div class="hard-two">
				<div class="img-ren"><img src="../shouye/img/7fc26cfaf6087299150ced3268fe6jpeg.jpg" /> </div>
				<div class="xxi">
					<div class="zhangh" style="font-size: 1rem;" v-html="info.attributes.username">1231231</div>
					<div class="shouji">
						<div><i class="Hui-iconfont">&#xe696</i></div>
						<div v-html="info.attributes.phone" class="phone">ss</div>
					</div>
				</div>
				<div class="geren"><i class="Hui-iconfont" style="font-size: 15px;">&#xe63d</i></div>
			</div>
		</div>
		<div class="huod">
			<a href="../yue/yue.html" class="huodong">
				<div class="huodong">
					<div><span style="color: #FF9900;">0.00</span>元</div>
					<div>余额</div>
				</div>
			</a>
			<div class="youhui">
				<div><span style="color: #FF5F3E;">0.00</span>个</div>
				<div>优惠</div>
			</div>
			<div class="jifen">
				<div><span style="color: #6AC20B;">0.00</span>分</div>
				<div>积分</div>
			</div>
		</div>

		<div class="w-biaod">
			<div class="w-d-dan">
				<div class="w-d-dan-one"><img src="img/icon_nav_article.png"></div>
				<div class="w-d-dan-tow">
					<a class="w-d-dan-tow" href="../dingdan/dingdan.html">
						<div class="mydingd" onclick="getajax()">我的订单</div>
						<div class="z-tu"><i class="Hui-iconfont" style="font-size: 15px;color: #BBBBBB;">&#xe63d</i></div>
					</a>
				</div>
			</div>
			<div class="j-fen">
				<div class="w-d-dan-one"><img src="img/icon_integral.png"></div>
				<div class="w-d-dan-tow">
					<div class="mydingd">积分商城</div>
					<div class="z-tu"><i class="Hui-iconfont" style="font-size: 15px;color: #BBBBBB;">&#xe63d</i></div>
				</div>
			</div>
			<div class="y-h-juan">
				<div class="w-d-dan-one"><img src="img/icon_coupon.png"></div>
				<div class="w-d-dan-tow">
					<div class="mydingd">优惠券</div>
					<div class="z-tu"><i class="Hui-iconfont" style="font-size: 15px;color: #BBBBBB;">&#xe63d</i></div>
				</div>
			</div>
		</div>

		<style type="text/css">
			.load2 {
				position: absolute;
				width: 200px;
				height: 160px;
				background: url('') no-repeat;
				margin-left: -96px;
				margin-top: -100px;
				left: 50%;
				top: 70%;
				animation: small .8s infinite;
				background-position: center;
			}
			
			@keyframes small {
				0% {
					transform: scale(1);
				}
				50% {
					transform: scale(.4);
				}
				100% {
					transform: scale(1);
				}
			}
			
			.load {
				position: absolute;
				left: 50%;
				top: 50%;
				background: url('img/922445-20170312171729982-1524461368.png');
				height: 100px;
				width: 100px;
				margin-left: -50px;
				margin-top: -50px;
				animation: test 4.5s steps(6) infinite, updown .8s infinite;
				/*-webkit-animation:test 3.5s steps(6) infinite;*/
			}
			
			@keyframes test {
				0% {
					background-position: 0 0;
				}
				100% {
					background-position: 0 600px;
				}
			}
			
			@keyframes updown {
				0% {
					transform: translateY(0px);
				}
				50% {
					transform: translateY(-50px);
				}
				100% {
					transform: translateY(0px);
				}
			}
		</style>

		<div id="loding" style="display: none;">
			<div class="load"></div>
			<div class="load2"></div>
		</div>
		<!--尾部-->
		<div class="weui-tabbar">
			<a href="../shouye/index.html" class="weui-tabbar__item weui-bar__item--on">

				<div class="weui-tabbar__icon">
					<img src="img/3c52a4dc0ae2021e30f3003085099png.png" alt="">
				</div>
				<p class="weui-tabbar__label">外卖</p>
			</a>
			<a href="../dingdan/dingdan.html" class="weui-tabbar__item">
				<div class="weui-tabbar__icon">
					<img src="img/2017-03-20_130206.png" alt="">
				</div>
				<p class="weui-tabbar__label">订单</p>
			</a>
			<a href="../wode/wode.html" class="weui-tabbar__item">
				<div class="weui-tabbar__icon">
					<img src="img/2017-03-20_130417.png" alt="">
				</div>
				<p class="weui-tabbar__label">我的</p>
			</a>

		</div>

		<script src="js/jquery-2.1.4.js"></script>
		<script src="js/fastclick.js"></script>
		<script src="js/jquery-weui.js"></script>
		<script src="js/swiper.js"></script>
		<script src="js/index.js"></script>
		<script src="../shouye/js/av-min-2.1.2.js"></script>
		<script type="text/javascript" src="../shouye/js/vue.js"></script>
		<script>
			$(function() {
				FastClick.attach(document.body);
				var curr = AV.User.current();
				if (curr) {
					// 跳转到首页
					//					 location.href='wode.html'; 
					console.log(curr);
					myvue.info = curr;
					console.log(myvue.info);
				} else {
					//currentUser 为空时，可打开用户注册界面…
					location.href = '../denglu/denglu.html';
				}
			});
		</script>

		<script>
			$(".swiper-container").swiper({
				loop: true,
				autoplay: 3000
			});
			//jsx
			function getajax() {
				//异步请求
				//1 创建对象
				var xhr;
				if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari
					xhr = new XMLHttpRequest();
				} else { // code for IE6, IE5
					xhr = new ActiveXObject("Microsoft.XMLHTTP");
				}
				//定义状态改变事件处理函数
				xhr.onreadystatechange = function() {
						if (xhr.readyState == 1) {
							document.getElementById("loding").style.display = "none";
						}
						if (xhr.readyState == 4 && xhr.status == 200)
							var obj = JSON.parse(xhr.responseText);
						document.getElementById("loding").style.display = "block";
					}
					//创建异步请求
				xhr.open("GET", "../dingdan/dingdan.html");
				//发送异步请求
				xhr.send()
			}
			//
		</script>

		<!--api-->
		<script type="text/javascript">
			var APP_ID = 'hMxRNdIevDj4IR3LHG0vJRNU-gzGzoHsz';
			var APP_KEY = 'e7oBIWOnxaDwD5yTBBRUdN4t';
			AV.init({
				appId: APP_ID,
				appKey: APP_KEY
			});
			var myvue = new Vue({
				el: "body",
				data: {
					list: "",
					info: ""
				},
				//				methods:{
				//					href:function(e){
				//						location.href="../xiangqing/shopmain.html?id="+e
				//					}
				//				}
			})
			var query = new AV.Query('_User');
			query.find().then(function(e) {
					myvue.list = e;
					console.log(e)
						//				var shangpintu = document.getElementsByClassName('shangpintu');
						//				for(var i = 0; i < shangpintu.length; i++){
						//					console.log(e[i].attributes.shopimg);
						//					shangpintu[i].src= e[i].attributes.shopimg;
						//					console.log(shangpintu[i].src);
						//			    }
				})
				//登出
			function login() {
				//				var username = document.getElementById("username").value;
				//				var pwd = document.getElementById("pwd").value;
				//				AV.User.logIn(username, pwd).then(function(loginedUser) {
				//					location.href = "../shouye/index.html"
				//				}, function(error) {
				//					alert("登录错误")
				//				});
				AV.User.logOut();
				// 现在的 currentUser 是 null 了
				location.href = '../denglu/denglu.html';
				var currentUser = AV.User.current();
			}
		</script>
	</body>

</html>